

package com.hazelcast.test.starter.answer;

import org.mockito.invocation.InvocationOnMock;

/**
 * Default {@link org.mockito.stubbing.Answer} to create a mock for a proxied
 * entry or item of a Hazelcast data structure, e.g.
 * {@link com.hazelcast.collection.impl.queue.QueueItem}.
 */
class DataStructureElementAnswer extends AbstractAnswer {

    DataStructureElementAnswer(Object delegate) {
        super(delegate);
    }

    @Override
    Object answer(InvocationOnMock invocation, String methodName, Object[] arguments) throws Exception {
        if (arguments.length == 0) {
            return invoke(invocation);
        }
        throw new UnsupportedOperationException("Method is not implemented in DataStructureElementAnswer: " + methodName);
    }
}
